package mspbots.data.sync.script;

import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;

import java.util.Map;

/**
 * @author Jay.Yang
 */
@Log4j2
@RestController
@RequiredArgsConstructor
@RequestMapping("scrpit")
public class ScriptController {

    private final DataSourceService dataSourceService;

    @PostMapping("source/selectData")
    public Flux<DataSourceResult> getSourceData(@RequestBody Map<String, Object> map) {
        return this.dataSourceService.getSourceData(map);
    }
}
